package com.caregiver.watch.business.data.model.dto;

import com.alibaba.fastjson2.annotation.JSONField;
import com.caregiver.watch.common.constant.NumberConstants;
import lombok.Data;

import java.util.Objects;

/**
 * 睡眠计算结果响应模型
 */
@Data
public class SleepCalculationResp {
    
    /**
     * 返回码
     */
    @JSONField(name = "ReturnCode")
    private Integer returnCode;
    
    /**
     * 消息
     */
    private String message;
    
    /**
     * 数据
     */
    private SleepCalculationData data;

    public boolean isSuccess() {
        return Objects.nonNull(returnCode) && returnCode == NumberConstants.ZERO;
    }
}
